import request from './request'

// 获取指定ID的慢性病记录
export const getChronicDiseaseApi = id => request.get(`/chronic-diseases/${id}`)

// 获取当前用户的慢性病列表
export const getCurrentUserDiseasesApi = () => request.get('/chronic-diseases/current')

// 创建慢性病记录
export const createChronicDiseaseApi = data => request.post('/chronic-diseases', data)
export const addChronicApi = data => request.post('/chronic-diseases', data)

// 更新慢性病记录
export const updateChronicDiseaseApi = (id, data) => request.put(`/chronic-diseases/${id}`, data)

// 删除慢性病记录
export const deleteChronicDiseaseApi = id => request.delete(`/chronic-diseases/${id}`)

// 根据状态获取慢性病列表
export const getDiseasesByStatusApi = status => request.get(`/chronic-diseases/status/${status}`)

// 获取即将随访的慢性病列表
export const getUpcomingFollowUpsApi = () => request.get('/chronic-diseases/upcoming-follow-ups')

// 更新随访状态
export const updateFollowUpStatusApi = (id, status) => request.put(`/chronic-diseases/${id}/follow-up-status`, null, {
    params: { status }
}) 